"Bidirectionalization for free" for monomorphic transformations
نویسندگان
چکیده
A bidirectional transformation is a pair of mappings between source andview data objects, one in each direction. When the view is modified, thesource is updated accordingly with respect to some laws. Over the years, alot of effort has been made to offer better language support for programmingsuch transformations. In particular, a technique known as bidirectionalizationis able to analyze and transform unidirectional programs written in generalpurpose languages, and “bidirectionalize” them.Among others, an approach termed semantic bidirectionalization pro-posed by Voigtländer stands out in terms of user-friendliness. A unidirec-tional program can be written using arbitrary language constructs, as longas the function it represents is polymorphic and the language constructs re-spect parametricity. The free theorems that follow from the polymorphictype of the program allow a kind of forensic examination of the transforma-tion, determining its effect without examining its implementation. This isconvenient, as the programmer is not restricted to using a particular syntax;but it does require the transformation to be polymorphic.In this paper, we lift this polymorphism requirement to improve the appli-cability of semantic bidirectionalization. Concretely, we provide a type classPackM γ αμ, which intuitively reads “a concrete datatype γ is abstractedto a type α, and the ‘observations’ made by a transformation on values oftype γ are recorded by a monad μ”. With PackM , we turn monomorphic Email addresses: [email protected] (Kazutaka Matsuda),[email protected] (Meng Wang) Preprint submitted to Science of Computer ProgrammingOctober 6, 2014 transformations into polymorphic ones that are ready to be bidirectionalized.We demonstrate our technique with case studies of typical applications ofbidirectional transformation, namely text processing, XML query and graphtransformation, which were commonly considered beyond semantic bidirec-tionalization because of their monomorphic nature.
منابع مشابه
Bidirectionalization for Free with Runtime Recording
A bidirectional transformation is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly with respect to some laws. Over the years, a lot of effort has been made to offer better language support for programming such transformations. In particular, a technique known as bidirectionalization is able to analyze an...
متن کاملToward Bidirectionalization of ATL with GRoundTram
ATL is a language for describing model transformations currently in uni-direction. In our previous work we have shown that transformations of graph structures given in some form can be bidirectionalized and have implemented a system called GRoundTram system for bidirectional graph transformations. We say a transformation t is bidirectionalized when we obtain a backward transformation t′ so that...
متن کاملMATHEMATICAL ENGINEERING TECHNICAL REPORTS Bidirectionalization Transformation Based on Automatic Derivation of View Complement Functions
Bidirectional transformation is a pair of transformations: a view function and a backward transformation. A view function maps one data structure called source onto another called view. The corresponding backward transformation reflects changes in the view to the source. Its practically useful applications include replicated data synchronization, presentation-oriented editor development, tracin...
متن کاملMATHEMATICAL ENGINEERING TECHNICAL REPORTS Type Specialization for Effective Bidirectionalization
A bidirectional transformation is a pair of transformations, a forward transformation and a backward transformation, where a forward transformation maps one data structure called source to another called view, and a corresponding backward transformation reflects changes on the view to the source. Its practical applications include replicated data synchronization, presentation-oriented editor de...
متن کاملEnhancing semantic bidirectionalization via shape bidirectionalizer plug-ins
Matsuda et al. (Matsuda, K., Hu, Z., Nakano, K., Hamana, M. & Takeichi, M. (2007) Bidirectionalization transformation based on automatic derivation of view complement functions. In Proceedings of the International Conference on Functional Programming. ACM Press, pp. 47–58) and Voigtländer (Voigtländer, J. (2009) Bidirectionalization for free! In Proceedings of Principles of Programming Language...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Sci. Comput. Program.
دوره 111 شماره
صفحات -
تاریخ انتشار 2015